package com.bringway.p2p.dao.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Repository;

import com.bringway.framework.dao.P2PJdbcDao;
import com.bringway.p2p.dao.DemoDao;

import net.sf.json.JSONObject;

@Repository
public class DemoDaoImpl extends P2PJdbcDao implements DemoDao {
	
	private Logger logger = Logger.getLogger(ComNewsDaoImpl.class);
	
	@Override
	public List<Map<String, Object>> queryDemoList(String nodeId) {
		String sql = "SELECT ID id,NAME text,URL url,PARENT_ID,(select count(*) from D_CCB_FM.T_FM_SYS_MENU WHERE PARENT_ID =ID) CH_NUM,0 children, '../framework/ligerui/lib/ligerUI/skins/Aqua/images/bubbles/03.Office.png' src FROM D_CCB_FM.T_FM_SYS_MENU WHERE PARENT_ID =:nodeId";
		Map<String,String> paramMap = new HashMap<String,String>();
		paramMap.put("nodeId", nodeId);
		logger.info("queryDemoList sql is "+sql.toString());
		return this.getNamedParameterJdbcTemplate().queryForList(sql.toString(), paramMap);
	}

	
	

}
